/**
 * @author Morten Tranberg Hansen (mth@daimi.au.dk)
 * @date   August 28 2008
 */

configuration HplEMPinsC {

	provides {
		interface GeneralIO as GIO1;
		interface GeneralIO as ADC0;
		interface GeneralIO as ADC1;
		interface GeneralIO as ADC2;
		interface GeneralIO as UTXD0;
		interface GeneralIO as URXD0;
		interface GeneralIO as GIO0;
		interface GeneralIO as I2C_SCL;
		interface GeneralIO as I2C_SDA;
		
		interface GeneralIO as ADC6;
		interface GeneralIO as ADC7;
		interface GeneralIO as GIO2;
		
		interface GeneralIO as GIO3;
		
		interface GeneralIO as ADC3;
	}

} implementation {

	components 
		HplMsp430GeneralIOC as GeneralIOC,
		new Msp430GpioC() as GIO1C,
		new Msp430GpioC() as ADC2C,
		new Msp430GpioC() as ADC1C,
		new Msp430GpioC() as ADC0C,
		new Msp430GpioC() as UTXD0C,
		new Msp430GpioC() as URXD0C,
		new Msp430GpioC() as GIO0C,
		new Msp430GpioC() as I2C_SCLC,
		new Msp430GpioC() as I2C_SDAC,
		new Msp430GpioC() as ADC6C,
		new Msp430GpioC() as ADC7C,
		new Msp430GpioC() as GIO2C,
		new Msp430GpioC() as ADC3C,
		new Msp430GpioC() as GIO3C;
	
	GIO1C -> GeneralIOC.Port21;
	ADC0C -> GeneralIOC.ADC0;
	ADC1C -> GeneralIOC.ADC1;
	ADC2C -> GeneralIOC.ADC2;
	UTXD0C -> GeneralIOC.UTXD0;
	URXD0C -> GeneralIOC.URXD0;
	GIO0C -> GeneralIOC.Port20;
	I2C_SCLC -> GeneralIOC.Port33;
	I2C_SDAC -> GeneralIOC.Port31;
	ADC6C -> GeneralIOC.ADC6;
	ADC7C -> GeneralIOC.ADC7;
	GIO2C -> GeneralIOC.Port23;
	ADC3C -> GeneralIOC.ADC3;
	GIO3C -> GeneralIOC.Port26;

	GIO1 = GIO1C;
	ADC0 = ADC0C;
	ADC1 = ADC1C;
	ADC2 = ADC2C;
	UTXD0 = UTXD0C;
	URXD0 = URXD0C;
	GIO0 = GIO0C;
	I2C_SCL = I2C_SCLC;
	I2C_SDA = I2C_SDAC;
	ADC6 = ADC6C;
	ADC7 = ADC7C;
	GIO2 = GIO2C;
	ADC3 = ADC3C;
	GIO3 = GIO3C;
	
	components MainC, HplEMPinsP;
	MainC.SoftwareInit -> HplEMPinsP;
	HplEMPinsP.I2C_SCL -> GeneralIOC.Port33;
	HplEMPinsP.I2C_SDA -> GeneralIOC.Port31;
	
}
